package com.xiyi.shouxin.view;

import com.xiyi.shouxin.exception.ErrorCode;

import lombok.Getter;

//通用的返回
@Getter
public class CommonModel {
    private int status;
    private String msg;
    private Object data;

    public CommonModel(int status, String msg, Object data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    public static CommonModel Success(Object data) {
        return new CommonModel(ErrorCode.OK.getCode(), ErrorCode.OK.getMsg(), data);
    }

    public static CommonModel Fail(int status, String msg, Object data) {
        return new CommonModel(status, msg, data);
    }
}
